package com.seveneight.baijiesteward.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by user1 on 2018/2/24.
 */

public class DateUtil {

    public static String formatDate(String date) {
        String dateStr = date.replace("T", " ");
        return dateStr;
    }
    public static String dateFormat(Long date){
        SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd");
        java.util.Date dt = new Date(date);
        String sDateTime = sdf.format(dt);  //得到精确到秒的表示：08/31/2006 21:08:00
        return sDateTime;
    }
    public static String dateFormatMonthDay(Long date){
        SimpleDateFormat sdf= new SimpleDateFormat("MM月dd日 HH:mm:ss");
        java.util.Date dt = new Date(date);
        String sDateTime = sdf.format(dt);  //得到精确到秒的表示：08/31/2006 21:08:00
        return sDateTime;
    }
    public static String dateLong(Long date){
        SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        java.util.Date dt = new Date(date);
        String sDateTime = sdf.format(dt);  //得到精确到秒的表示：08/31/2006 21:08:00
        return sDateTime;
    }

}
